
<!DOCTYPE HTML PUBLIC "-//W3C//DTD -//W3C//DTD HTML 4.01//EN//EN" "">
<%@ page contentType="text/html; charset=utf-8" %>
<%@page import="controller.Controller"%>
<%@ page import="java.util.*,dataBase.*"%>
<%@page import="com.google.appengine.api.datastore.Key"%>
<%@page import="sessionMenegment.SessionMgr"%>
<%@page import="language.LangFactory"%>
<%@page import="language.LangIntrf"%>
<%@page import="util.Util"%>

<%
	SessionMgr sessionMgr = SessionMgr.getInst();
	boolean user = sessionMgr.checkUser(request,session);
	if(!user)
		response.sendRedirect("home.jsp");
%>
<%
	LangFactory langFactory= new LangFactory();
	String langName = request.getParameter("lang");
	LangIntrf lang =null;
	if(langName!=null){
		lang = langFactory.getLang(request.getParameter("lang"));
		session.setAttribute("lang",langName);
	}
	else
		lang = langFactory.getLang((String)session.getAttribute("lang"));
	String langSign = lang.getLang();
	
	
%>
<html>

	<head>
		<link rel="icon" href="../images/synca.png" type="image/x-icon"/> 
		<link rel="shortcut icon" href="../images/synca.png" type="image/x-icon"/>
		<link href="../style.css" rel="stylesheet" type="text/css" />
		<link href="../e.css" rel="stylesheet" type="text/css" />
		<link href="../try3.css" rel="stylesheet" type="text/css" />
		<link href="http://dl.dropbox.com/u/22035932/jPicker-1.1.6.min.css" type="text/css"  rel="stylesheet" />
		<link href="http://dl.dropbox.com/u/22035932/jPicker.css" type="text/css" rel="stylesheet" />
        <% 
        	
    	Controller controller2 = Controller.getInstance();
    	Business business2 =  controller2.getBiz((String)session.getAttribute("userNameBusiness"));
    	if(business2==null){
    		response.sendRedirect("home.jsp");
    	}
    	String border = business2.getBorderColor();
    	String background = business2.getBackground();
    	String messageBG = business2.getSecBackground();
         	
        	if (border!=null && background!=null && messageBG!=null ){
        %>
        
        <style type="text/css">
        	.formButton2{
        		border:solid 2px <%=border%>;
        		background-color: <%=messageBG%>;
        		color:#000;
        	}
        	<!-----  style.css  ----->
        	body {
        		background-color: <%=background%>;
        	}
        	#container {
        		background-color: <%=background%>;
        	}
        	#header {
        		background-color: <%=messageBG%>;
        		border-bottom: solid 2px <%=border%>;
        	}
        	#headerLogedIn{
        		background-color: <%=messageBG%>;
        		border-bottom: solid 2px <%=border%>;
        	}
        	#headerLogedIn #logo{
        		color: <%=background%>;
        	}
        	.menu_nav li,.menu_nav_logedIn li {
        		background-color: <%=background%>;
        		border:solid 2px <%=border%>;
        	}
        	#left_sidebar {
        		background-color: <%=background%>;
        	}
        	#left_sidebar button{
        		color:<%=background%>;
        		background-color: <%=messageBG%>;
        		border:solid 2px <%=border%>;
        	}
        	
        	.control_bar {
        		background-color: <%=background%>;
        	}
        	#main_content{
        		background-color: <%=background%>;
        	}
        	#footer {
        		background-color: <%=messageBG%>;
        		border-top: solid 2px <%=border%>;
        	}
        	#stylized .formButton{
        		color:<%=background%>;
        		background-color: <%=messageBG%>;
        		border:solid 2px <%=border%>;
        	}
        	#stylized{
        		background:<%=background%>;
        		border:solid 2px <%=border%>;
        	}
        	#messageBox{
        		background-color: <%=background%>;
        		border: solid 2px <%=border%>;
        		
        	}
        	#messageBox button{
        		color:<%=background%>;
        		background-color: <%=messageBG%>;
        		border:solid 2px <%=border%>;
        	}
        	.menu_nav {
        		background-color:<%=messageBG%>;
        	}
        	.menu_nav_logedIn {
        		background-color:<%=messageBG%>;
        	}
        	.side_buttons li {
        		background-color: <%=messageBG%>;
        		border:solid 2px <%=border%>;
        	}
        	.list{
        		border: solid 2px <%=messageBG%>;
        	}
        	#left_sidebar form{
        		border:solid 2px <%=border%>;
        	}
        	.list{
        		border: solid 2px <%=border%>;
        	}
        	
        	
        	/*-----  e.css  -----*/
        	
        	
        	.statusChange{
        		background-color: <%=background%>;
        		border:solid 2px <%=border%>;
        	}
        	.heading {
        		background-color:<%=messageBG%>;
        	}
        	.wraper {
        		background-color:<%=messageBG%>;
        		border-color: <%=border%>;
        	}
        	.content {
        		background-color:<%=messageBG%>;
        	}
        	.currentStatus {
        		border:solid 2px <%=border%>;
        	}
        	
        </style>
        <%} %>
        <script type="text/javascript" src="../jquery-1.3.2.min.js"></script>
        <script type="text/javascript" src="../jquery.tools.min.js"></script>
		<script type="text/javascript" src="../jquery-ui-1.7.1.custom.min.js"></script>
        <script type="text/javascript" src="../jquery.address-1.4.min.js"></script>
        <script src="../javascript/jpicker-1.1.6.min.js" type="text/javascript"></script>
		<title>Synca</title>
		 <%
		 	Controller controller = Controller.getInstance();
		 	String bizName = (String)session.getAttribute("userNameBusiness");
		 	Business business = controller.getBiz(bizName);
		 %>
        <script>
			jQuery(document).ready(
				function() {
					$.fn.jPicker.defaults.images.clientPath='../images/';
					$("#myform2").submit(function() {
						addItemsToForm();
					}); 
					$.address.history(false).strict(false).change(function(event){																	
						var tab = event.value;									
						(tab=='general' || tab=='') ? visiableMain('general') : hiddenMain('general');
						(tab=='statuses') ? visiableMain('statuses') : hiddenMain('statuses');
						(tab=='messages') ? visiableMain('messages') : hiddenMain('messages');
						(tab=='colors') ? visiableMain('colors') : hiddenMain('colors');
						(tab=='embed') ? visiableMain('embed') : hiddenMain('embed');
						(tab=='advertisement') ? visiableMain('advertisement') : hiddenMain('advertisement');
						(tab=='times') ? visiableMain('times') : hiddenMain('times');
						

   					}).history(true);
					$("#logOut").click(function(){
							$.post("logOutBusiness",function(){$(location).attr('href','home.jsp');});
					});
					$("#profile").click(function(){
						$.post("myProfileBusiness",function(){$(location).attr('href','myProfileBusiness2.jsp');});
				    });
					$("#closeBox").click(function(){
							$(this).parent().slideUp(500);
					});
					$("#newOrder").click(function(){
							$("#messageBox").slideToggle(500);
					});
					$("#newOrderButton").click(function(){
							$("#messageBox").slideToggle(500);
					});
					// Example 1.2: Sortable and connectable lists
					$('#example-1-2 .sortable-list').sortable({
						connectWith: '#example-1-2 .sortable-list'
					});

					  $(".content").hide();
					  $(".arrow").click(function()
					  {
						  changeDivContent("statusDiv",$(this).parent());
					  });
					  $(".message").click(function()
					  {
						  changeDivContent("messageDiv",$(this).parent());
						  });
					  $(".cogWheel").click(function()
					  {
						  changeDivContent("settingDiv",$(this).parent());				
					  });
					  
					  $(".exit").click(function(){
						  	$(this).parent().hide(500);
					  });
					  $("#terminal").click(function(){
						  window.location.href = "allOrders.jsp";
					  });
					  $(".statusChange").click(function ()
					 {
						  elem = $(this).parent().parent().parent().find("#orderId").val();
							  $.post("changeStatusBusiness", {orderID: elem,newStatus:$(this).val()}, function() {
								  $(location).attr('href','allOrders.jsp');
								  changeStatus($(this).html('il'),$(this).parent().parent());
								  },"html");
							  
							  
					 });
					  $('#pickColor1').jPicker({
				          window:{
				            expandable: true,
				            position:	{x: 'screenCenter', y: '-450'},
							liveUpdate: true},
			 		   	color:
			           				{alphaSupport: true,
			             			 	active: new $.jPicker.Color({ ahex: '<%= business.getBackground()%>' })
			           				}
				          
					});
					$('#pickColor2').jPicker({
				          window:{
				            expandable: true,
				            position:	{x: 'screenCenter', y: '-450'},
							liveUpdate: true},
			 		   	color:
			           				{alphaSupport: true,
			             			 	active: new $.jPicker.Color({ ahex: '<%= business.getSecBackground()%>' })
			           				}
				          
					});
					$('#pickColor3').jPicker({
				          window:{
				            expandable: true,
				            position:	{x: 'screenCenter', y: '-450'},
							liveUpdate: true},
			 		   	color:
			           				{alphaSupport: true,
			             			 	active: new $.jPicker.Color({ ahex: '<%= business.getBorderColor()%>' })
			           				}
				          
					});
					$("#sortable1").sortable();
					order = $("#sortable1").sortable('serialize',{attribute:'name'});
					$("#sortable1").disableSelection();
					$("#sortable2").sortable();
					order = $("#sortable2").sortable('serialize',{attribute:'name'});
					$("#sortable2").disableSelection();
					
					var background = ['f5f5f5','ffaaaa','bfffaa','ffffff'];
					var messageBG = ['6699cc','ff5656', 'aced21', '8d967b'];
					var border = ['3366cc','ff0000', '0b8205', '000000'];
					
					 $("#pageColorSelect").change(function(){
							var pos = $(this).val();
							$.jPicker.List[0].color.active.val('hex', background[pos], this);
							$.jPicker.List[1].color.active.val('hex', messageBG[pos], this);
							$.jPicker.List[2].color.active.val('hex', border[pos], this);

							
						});
					 $("#preview").click(function(){
					 	window.open('http://syncahore.appspot.com/preview.jsp?background='+$.jPicker.List[0].color.active.val("hex")+'&messageBG='+$.jPicker.List[1].color.active.val('hex')+'&border='+$.jPicker.List[2].color.active.val('hex'));
					 });
					  changeStatus = function(val,elem){
						  
					  }
					  changeDivContent = function(divName,elem){
						//  confirm(divName);
							if(divName=='settingDiv'){
								openDiv('settingDiv',elem)
						//		confirm("if");
					  		}
							else{
								
								closeDiv('settingDiv',elem);
							//	confirm("else");
							}
						//	confirm("xfx");
					  		(divName=='messageDiv') ? openDiv('messageDiv',elem) : closeDiv('messageDiv',elem);
					  		
							(divName=='statusDiv') ? openDiv('statusDiv',elem) : closeDiv('statusDiv',elem);
					  }
					  
					  openDiv = function(divName1,elem){
						  
						  elem.find('#'+divName1).attr('class','content');
						//  confirm("1");
						  //if(elem.find('#'+divName1).is(':not(:visiable)')){  
						//	  confirm("3");
							  elem.find('#'+divName1).slideToggle(500);	  
					//	  }
						//  confirm("2");
						  return true;
					  }
					  
					  closeDiv = function(divName,elem){
						  elem.find('#'+divName).attr('class','hiddenMain');
					//	  if(elem.find('#'+divName).is(':visiable')){
							  elem.find('#'+divName).hide(500);	  
					//	  }
						  return true;
					  }
					
				}
			);
			var getSortOrder = function(){
				var x='';
				$.each($("#sortable").sortable('toArray'), function(index,value){
						x=x+'index '+index+': '+value+'\n';
					});
				return x;
			 }
			var addItemsToForm = function(){
				/* $.each($("#sortable1").sortable('toArray'), function(index,value){
					addHiddenInput('#myform2','list_'+index,value);
					}); */
				$("#sortable1 li").each(function(index,value){
					addHiddenInput('#myform2','list_'+index,this.getAttribute('value'));
				});
				$("#sortable2 li").each(function(index,value){
					addHiddenInput('#myform2','message_'+index,this.getAttribute('value'));
				});
				/* $.each($("#sortable2").sortable('toArray'), function(index,value){
					addHiddenInput('#myform2','message_'+index,value);
				}); */
				addHiddenInput('#myform2','background','#'+$.jPicker.List[0].color.active.val("hex"));
				addHiddenInput('#myform2','secBackground','#'+$.jPicker.List[1].color.active.val("hex"));
				addHiddenInput('#myform2','borderColor','#'+$.jPicker.List[2].color.active.val("hex"));
				
		
			 } 
			 var addHiddenInput = function(formName,attName,attVal){
				 $('<input />').attr('type', 'hidden')
		            .attr('name', attName)
		            .attr('value', attVal)
		            .appendTo(formName);
			 }
			 var removeItem = function(x){
				 //alert("asdasd "+x);
				 $(x).remove();
				 
			 }
			 var liIndex=0;
			 var addItem = function(identifier,sortable){
				 if($("#"+identifier).val()!=''){
				 	$("#"+sortable).append('<li id="list_'+sortable+liIndex+'" value="list_'+$("#"+identifier).val().replace(/ /g,'@')+'">'+$("#"+identifier).val()+'   <a href="" onclick="removeItem(list_'+sortable+liIndex+'); return false;">     <%=lang.getREMOVE_LABEL() %></a></li>');
				 	$("#"+identifier).val('');
				 }
			 }
			var visiableMain = function(tab){
				
				$('#main_content #'+tab).attr('class','');
				$('#menu #'+tab).attr('class','choosenButton');
			}
			
			var hiddenMain = function(tab){
				
				$("#main_content #"+tab).attr('class','hiddenMain');
				$('#menu #'+tab).attr('class','');
			}
	
				


			


		</script>
        
	</head>

	<body>
<div id="container">
		
		<div id="headerLogedIn">

        <div class="menu_nav_logedIn menu_nav_logedIn2">
            <ul id="menu">
            	<li id="terminal"><%=lang.getTERMINAL_BUTTON() %></li>
                <li id="profile"><%=lang.getMT_PROFILE_BUTTON() %></li>
                <li id="logOut"><%=lang.getLOG_OUT_BUTTON() %></li>
            </ul>
        </div>	
        	
		</div>

		<div id="left_sidebar">
			<%if (business.getLogoPic()!=null){ %>
				<img src="../showImage?imageKey=<%=business.getUserName() %>" width="150" />
			<% }else{ %>
				<img src="../images/tempLogo.png" width="150" />
			<%} %>
            <div class="side_buttons">
                <ul>
                    <a href="#general"><li><%=lang.getGENERAL_BUTTON() %></li></a>
                    <a href="#statuses"><li><%=lang.getSTATUSES_BUTTON() %></li></a>
                    <a href="#messages"><li><%=lang.getMESAGESS_BUTTON() %></li></a>
                    <a href="#times"><li><%=lang.getTIMES_BUTTON()%></li></a>
                    <a href="#colors"><li><%=lang.getCOLOR_BUTTON()%></li></a>
                    <a href="#embed"><li><%=lang.getEMBED_BUTTON() %></li></a>
                    <a href="#advertisement"><li><%=lang.getADV_BUTTON() %></li></a>
                </ul>
        	</div>
		</div>
			
<div id="main_content">
 <div style="padding-left: 43%; font-size: 20px; font-weight: bold;  "><%=lang.getMY_PROFILE_LABEL() %></div>
 <center>

<br />

 <form id="myform2" enctype="multipart/form-data" method="post" action="changePropertiesBusiness" accept-charset="ISO-8859-1">
 <div id="general">
 	<div id="stylized" class="myform1">
                    
                    <h1><%=lang.getGENERAL_LABEL() %></h1>
                    <p></p>

                    <div id="firstForm">
                    
                    <table dir="<%=lang.getDirection()%>">
                    	<tr>
                        	<td>
                            	<label class="reg"><%=lang.getUSERNAME_LABEL() %></label>
                            </td>
                            <td>
                            	<input type="text"  id="userName" name="userName" title="select free user name"  disabled="disabled" value="<%= business.getUserName()%>"/>
                            </td>
                        </tr>
                        <tr>
                        	<td>
                            	<label class="reg"><%=lang.getPASSWORD_LABEL() %></label>
                            </td>
                            <td>
                            	<input type="password"  id="password" name="password" title="choose password" value="<%= business.getPassword()%>"/>
                            </td>
                        </tr>
                        <tr>
                        	<td>
                            	<label class="reg"><%=lang.getCONFIRM_PASSWORD_LABEL() %></label>
                            </td>
                            <td>
                            	<input type="password" id="password1" name="password1" title="confirm the password" value="<%= business.getPassword()%>"/>
                            </td>
                        </tr>
                        <tr>
                        	<td>
                            	<label class="reg"><%=lang.getEMAIL_LABEL() %></label>
                            </td>
                            <td>
                            	<input type="text"  id="email" name="email" title="In this email you will get confirmation about the registration" value="<%= business.getEmail().getEmail()%>"/>
                            </td>
                        </tr>
                        <tr>
                        	<td>
                            	<label class="reg"><%=lang.getBUSINESS_NAME_LABEL() %></label>
                            </td>
                            <td>
                            	<input type="text"  id="businessName" name="businessName" title="This business name the customer will see" value="<%= business.getBizName()%>"/>
                            </td>
                        </tr>
                        <tr>
                        	<td>
                            	<label class="reg"><%=lang.getBUSINESS_NUMBER_LABEL() %></label>
                            </td>
                            <td>
                            	<input type="text"  id="businessNumber" name="businessNumber" title="fiil your business number" value="<%= business.getBizNum()%>"/>
                            </td>
                        </tr>
                        <tr>
                        	<td>
                            	<label class="reg"><%=lang.getPHONE_NUMBER_LABEL() %></label>
                            </td>
                            <td>
                            	<input type="text"  id="phone"  name="phone" title="fiil your phone number" value="<%= business.getPhoneNumber().getNumber()%>"/>
                            </td>
                        </tr>
                        <tr>
                        	<td>
                            	<label class="reg"><%=lang.getBUSINESS_WEBSITE_LABEL()%></label>
                            </td>
                            <td>
                            	<input value="<%=business.getWebsite() %>" type="text"  id="site"  name="site" title="fiil your website address"/>
                            </td>
                        </tr>
                        <tr>
                        	<td>
                            	<label class="reg"><%=lang.getSKYPE_LABEL()%></label>
                            </td>
                            <td>
                            	<input value="<%=business.isSkypeLogin() %>" type="text"  id="skype"  name="skype" title="fiil your Skype user name"/>
                            </td>
                        </tr>
                        <tr>
                        	<td>
                            	<label class="reg"><%=lang.getBUSINESS_LOGO_LABEL()%></label>
                            </td>
                            <td>
                            	<%if (business.getLogoPic()!=null){ %>
									<img src="../showImage?imageKey=<%=business.getUserName() %>" width="150" />
								<% }%>
                            </td>
                        </tr>
                        <tr>
                        	<td>
                            	<label class="reg"></label>
                            </td>
                            <td>
                            	<input type="file"  id="bizLogo"  name="bizLogo" title="upload your business logo" accept="image/*"/>
                            </td>
                        </tr>
                    </table>
                    </div>
                    
                    <div class="spacer"></div>
                    
                    
                </div>
          		<button class="formButton2" type="submit" id="submitButton" ><%=lang.getSAVE_ALL_BUTTON() %></button>
          </div>
          <div id="statuses">
          		<div id="stylized" class="myform1">
                    <h1><%=lang.getSTATUSES_LABEL()%></h1>
                    <p></p>
						<%
							List<Status> statuses = controller.getStatusesOfBiz(bizName);
							ArrayList<String> messages = business.getMessages();
						%>
                        <div class="listDiv">                        	
                            <ul id="sortable1">
                            	<%
                            		int counter=0;
                            		for(Status s : statuses){
                            	%>
                            	<li id="list_<%=counter %>" value="list_<%= s.getStatusName() %>"> <%= s.getStatusName() %>  <a href="" onclick="removeItem(list_<%=counter %>); return false;">     <%=lang.getREMOVE_LABEL() %></a></li>
                            	<% 		counter++;
                            		} 
                            	%>
                            </ul>
                            <input type="text" id="t1" title="You can add,delete or move your Statuses. we bring you suggestion for statuses."/><br><input type="button" onClick="addItem('t1','sortable1');" value="<%=lang.getADD_BUTTON()%>"/>
                        </div>                                                                      
                    
                   
                    
                    <div class="spacer"></div>
                    
                    
                </div>	
          		<button class="formButton2" type="submit" id="submitButton" ><%=lang.getSAVE_ALL_BUTTON() %></button>
          </div>
          <div id="messages">
          		<div id="stylized" class="myform1">
                    <h1><%=lang.getMESSAGES_LABEL() %></h1>
                    <p></p>
                        <div class="listDiv">                        	
                            <ul id="sortable2">
                            	<%
                            		counter=0;
                            		for(String s : messages){
                            	%>
                            	<li id="message_<%=counter %>" value="list_<%=s%>"> <%=s%>  <a href="" onclick="removeItem(message_<%=counter %>); return false;">     <%=lang.getREMOVE_LABEL() %></a></li>
                            	<% 		counter++;
                            		} 
                            	%>
                            </ul>
                            <input type="text" id="t2" title="You can add,delete or move your Statuses. we bring you suggestion for statuses."/><br><input type="button" onClick="addItem('t2','sortable2');" value="<%=lang.getADD_BUTTON() %>"/>
                        </div>                                                                      
  
                    <div class="spacer"></div>
                    
                    
                </div>
          		<button class="formButton2" type="submit" id="submitButton" ><%=lang.getSAVE_ALL_BUTTON() %></button>
          </div>
          <div id="times">
          		<div id="stylized" class="myform1">
                    <h1><%=lang.getPRIORITY_TIMES_LABEL() %></h1>
                    <p></p>
                    <div class="x">
                        <table dir="<%=lang.getDirection()%>">
                        	<tr>
                        		<td align="left"><%=lang.getLOW_LABEL() %></td>
                        		<td><input class ="x" width="5px" type="text" value="<%=Util.getTime(business.getOrderUrgencyTime()[0],Util.Times.DAYS)%>" name="days0"/> <%=lang.getDAYS_LABEL() %>,   &nbsp;&nbsp;<input class ="x" width="5px" type="text" value="<%=Util.getTime(business.getOrderUrgencyTime()[0],Util.Times.HOURS)%>" name="hours0"/> <%=lang.getHOURS_LABEL() %>, &nbsp;&nbsp;   <input class ="x" width="5px" type="text" value="<%=Util.getTime(business.getOrderUrgencyTime()[0],Util.Times.MINUTES)%>" name="minutes0"/><%=lang.getMINUTES_LABEL() %></td>
                        	</tr>
                        	<tr>
                        		<td align="left"><%=lang.getMEDIUM_LABEL() %></td>
                        		<td><input class ="x" width="5px" type="text" value="<%=Util.getTime(business.getOrderUrgencyTime()[1],Util.Times.DAYS)%>" name="days1"/> <%=lang.getDAYS_LABEL() %>,   &nbsp;&nbsp;<input class ="x" width="5px" type="text" value="<%=Util.getTime(business.getOrderUrgencyTime()[1],Util.Times.HOURS)%>" name="hours1"/> <%=lang.getHOURS_LABEL() %>, &nbsp;&nbsp;   <input class ="x" width="5px" type="text" value="<%=Util.getTime(business.getOrderUrgencyTime()[1],Util.Times.MINUTES)%>" name="minutes1"/> <%=lang.getMINUTES_LABEL() %></td>
                        	</tr>
                        	<tr>
                        		<td align="left"><%=lang.getHIGH_LABEL() %></td>
                        		<td><input class ="x" width="5px" type="text" value="<%=Util.getTime(business.getOrderUrgencyTime()[2],Util.Times.DAYS)%>" name="days2"/> <%=lang.getDAYS_LABEL() %>,   &nbsp;&nbsp;<input class ="x" width="5px" type="text" value="<%=Util.getTime(business.getOrderUrgencyTime()[2],Util.Times.HOURS)%>" name="hours2"/> <%=lang.getHOURS_LABEL() %>, &nbsp;&nbsp;   <input class ="x" width="5px" type="text" value="<%=Util.getTime(business.getOrderUrgencyTime()[2],Util.Times.MINUTES)%>" name="minutes2"/> <%=lang.getMINUTES_LABEL() %></td>
                        	</tr>
                        </table>                                                               
  						</div>
                    <div class="spacer"></div>
                    
                    
                </div>
          		<button class="formButton2" type="submit" id="submitButton" ><%=lang.getSAVE_ALL_BUTTON() %></button>
          </div>
          <div id="colors">
          		<div id="stylized" class="myform1">
                    <h1><%=lang.getCOLORS_LABEL()%></h1>
                    <p></p>
						<%if(lang.getAlign().equals("left")){ %>
                        <label><%=lang.getCHOOSE_COLOR_LABEL() %></label>
                        <select id="pageColorSelect">
                        	<option id="deflt"><%=lang.getCOLOR_LABEL() %></option>
                        	<option id="blue" value="0" style="background-color: blue;"><%=lang.getCOLOR_BLUE_LABEL()%></option>
                        	<option id="red" value="1" style="background-color: red;"><%=lang.getCOLOR_RED_LABEL() %></option>
                        	<option id="green" value="2" style="background-color: green;"><%=lang.getCOLOR_GREEN_LABEL() %></option>
                        	<option id="black" value="3" style="background-color: black; color:white;"><%=lang.getCOLOR_BLACK_LABEL() %></option>
                        </select><br />
                        <%}else{ %>
                        <select id="pageColorSelect">
                        	<option id="deflt"><%=lang.getCOLOR_LABEL() %></option>
                        	<option id="blue" value="0" style="background-color: blue;"><%=lang.getCOLOR_BLUE_LABEL()%></option>
                        	<option id="red" value="1" style="background-color: red;"><%=lang.getCOLOR_RED_LABEL() %></option>
                        	<option id="green" value="2" style="background-color: green;"><%=lang.getCOLOR_GREEN_LABEL() %></option>
                        	<option id="black" value="3" style="background-color: black; color:white;"><%=lang.getCOLOR_BLACK_LABEL() %></option>
                        </select>
                        <label><%=lang.getCHOOSE_COLOR_LABEL() %></label>
                        <%} %>
                        <table>
                        	<tr>
                        		<td><span id="pickColor1" class="colorPicker"></span></td>
                        		<td><%=lang.getBACKGROUND_LABEL() %></td>
                        	</tr>
                        	<tr>
                        		<td><span id="pickColor2" class="colorPicker"></span></td>
                        		<td><%=lang.getSECOND_BACKGROUND_LABEL() %></td>
                        	</tr>
                        	<tr>
                        		<td><span id="pickColor3" class="colorPicker"></span></td>
                        		<td><%=lang.getBORDER_COLOR_LABEL() %></td>
                        	</tr>
                        </table>                                                               
                        <br />
                        <span id="preview"><%=lang.getPREVIEW_LABEL() %></span>
                    
                    
                    <div class="spacer"></div>
                    
                    
                </div>
                <button class="formButton2" type="submit" id="submitButton" ><%=lang.getSAVE_ALL_BUTTON() %></button>
                
          </div>
          <div id="embed">
          
          	<textarea rows="7" cols="50"><iframe src="<%=Controller.getInstance().getSyncaWebAddress()%>/orderForm.jsp?bizName=<%= business.getUserName()%>" width="400" height="300"></iframe></textarea><br/>
          	<button class="formButton2" type="submit" id="submitButton" ><%=lang.getSAVE_ALL_BUTTON() %></button>
          	
          </div>
				<%String validateError = (String)session.getAttribute("validError");
					if(validateError!=null){	
				%>
				<label style="color: #ff0000" ><%=validateError %></label>
				<%		session.setAttribute("validError",null);
					}%>
          </form>
          <div id="advertisement">
          	<div id="stylized" class="myform1">
          		<h1><%=lang.getADV_LABEL()%></h1>
                    <p></p>
	          	<form action="addAdBusiness" method="post" enctype="multipart/form-data">
	          		<table dir="<%=lang.getDirection()%>">
	          		  <%
		          		int size = business.getAds().size();
				    	for (int i=0; i<size; i++){%>
					    	<tr>
					    	<td><img src="/showImage?imageKey=<%=bizName %>&id=<%=i %>" /></td>
					    	<td><a href="deleteAdBusiness?id=<%=i%>"><%=lang.getREMOVE_LABEL() %></a></td>	
				      <%}%>
	          		</table><br/>
	          		<label><%=lang.getADD_ADV_LABEL() %></label><br/>
	          		<table dir="<%=lang.getDirection()%>">
		          		<tr>
		          		<td><%=lang.getFILE_LABEL() %></td>
		          			<td>
	          					<input type="file" name="newAd">
	          				</td>
	          				
	          			</tr>
	          			<tr>
	          				<td><%=lang.getLINK_LABEL()%></td>
	          				<td>
	          					<input type="text" name="link">
	          				</td>
	          				
	          			</tr>
	          		</table>
 	          		<button class="formButton2" type="submit"><%=lang.getSAVE_BUTTON() %></button>
	          	</form>
          	</div>
          </div>
          
 </center>

	<div class="clearer">&nbsp;</div>
</div>	


		<div id="footer">
	<a href="myProfileBusiness2.jsp?lang=he"><img src="../images/hebrew.gif" width="30px" style="float: left; margin-top: 0.5%; margin-left: 0.5%;"/></a>
	<a href="myProfileBusiness2.jsp?lang=en"><img src="../images/english.gif" width="30px" style="float: left; margin-top: 0.5%;margin-left: 0.5%;"/></a>

<center>
		<p><%=lang.getCOPY_RIGHT_LABEL()%> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;               
			<a href="home.jsp"><%=lang.getHOME_BUTTON()%></a> &nbsp;&nbsp;| &nbsp;&nbsp;
			<a href="home.jsp#customers"><%=lang.getCONTACT_BUTTON()%></a> &nbsp;&nbsp;|&nbsp;&nbsp;
			<a href="home.jsp?#about"><%=lang.getABOUT_BUTTON()%></a>
		</p>
		</center>
	</div>
</div>


	</body>

</html>
